const getDateTime = () => {
  return new Date()
}

const getGreeting = () => {
  const datetime = getDateTime()
  const hour = datetime.getHours()
  let greeting = ''
  if (hour >= 6 && hour <= 13) greeting = '上午好！'
  else if (hour > 13 && hour <= 18) greeting = '下午好！'
  else greeting = '晚上好！'
  return greeting
}

export { getDateTime, getGreeting }
